package cn.itcast.controller;

import cn.itcast.domain.Account;
import cn.itcast.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.Serializable;

/**
 * 请求参数绑定
 */
@Controller
@RequestMapping(value = "/param")
public class paramController  implements Serializable {
    /**
     * 请求参数绑定入门
     * @returncsddd  dadsd
     */
    @RequestMapping("/testParam")
    public String testParam(String username ,String password){
        System.out.println("Param.....testParam");
        System.out.println("username : "+username);
        System.out.println("password : " + password);
        return "success";
    }

    @RequestMapping("/saveAccount")
    public String saveAccount(Account account){
        System.out.println("Param.....saveAccount123");
        System.out.println(account);
        return "success";
    }

    @RequestMapping("/saveUser")
    public String saveUser(User user){
        System.out.println("Param.....saveUser123");
        System.out.println(user);
        return "success";
}



}
